class AdejustmentDetailResponse {
  final int code;
  final AdejustmentDetail? data;
  final String msg;

  AdejustmentDetailResponse({
    required this.code,
    required this.data,
    required this.msg,
  });

  factory AdejustmentDetailResponse.fromJson(Map<String, dynamic> json) {
    return AdejustmentDetailResponse(
      code: json['code'] as int,
      data: json['data'].isNotEmpty ? AdejustmentDetail.fromJson(json['data']) : null,
      msg: json['msg'] as String,
    );
  }

}

class AdejustmentDetail {
  final int id;
  final Warehouse warehouse;
  final Location location;
  final String packKey;
  final String? lpnNumber;
  final String? itemNumber;
  final int? quantity;

  AdejustmentDetail({
    required this.id,
    required this.packKey,
    required this.location,
    required this.warehouse,
    required this.lpnNumber,
    required this.itemNumber,
    required this.quantity,
  });

  factory AdejustmentDetail.fromJson(Map<String, dynamic> json) {
    return AdejustmentDetail(
      id: json['id'] as int,
      location: Location.fromJson(json['location']),
      warehouse: Warehouse.fromJson(json['warehouse']),
      packKey: json['pack_key'] as String,
      lpnNumber: json['lpn_number'] as String?,
      itemNumber: json['item_number'] as String?,
      quantity: json['quantity'] as int?,
    );
  }
}

class Location {
  final int id;
  final String number;

  Location({
    required this.id,
    required this.number,
  });

  factory Location.fromJson(Map<String, dynamic> json) {
    return Location(
      id: json['id'] as int,
      number: json['number'] as String,
    );
  }
}

class Warehouse {
  final int id;
  final String name;
  final String code;

  Warehouse({
    required this.id,
    required this.name,
    required this.code,
  });

  factory Warehouse.fromJson(Map<String, dynamic> json) {
    return Warehouse(
      id: json['id'] as int,
      name: json['name'] as String,
      code: json['code'] as String,
    );
  }
}